app.controller('yinhuanchangsuoCtrl',['$scope','$http','$location','mainService',function ($scope,$http,$location,mainService) {
    var token = localStorage.getItem('token');
    $http({
        method: "POST",
        url: mainUrl+'/om/om-orgnization!findLevelTree4App.action',
        params: {
            'Authorization': token,
            'qm.nodeId' : 'GF-01'
        }
    }).then(
        function(data, status, headers, config){
            console.log(data);
            $scope.item = data.data.items
        },function(data, status, headers, config){

        }
    );
    $scope.initData = function ($event) {
        if (mainService.getData().page == 'luru') {
            mainService.getData().yhcsData = $event;
            mainService.getData().yhcs = $event.orgFullName;
            //localStorage.setItem('dateInput',mainService.getData().dateInput);
            console.log(mainService.getData());
            console.log(mainService.getData().dateInput);
            $location.path('/yinhuanluru')
        } else {
            mainService.getData().yhcsData = $event;
            mainService.getData().yhcs = $event.orgFullName;
            //localStorage.setItem('dateInput',mainService.getData().dateInput);
            console.log(mainService.getData())
            console.log(mainService.getData().dateInput)
            $location.path('/yinhuanliuzhuan')
        }
    }
}])